<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Set集合</title>
</head>
<body>
    <script>
      //创建集合
      let s =new Set();

      //添加
     s.add("zz");
     s.add("zc");
     s.add("zx");

     //获取长度
      document.write(s.size+"<br>");

      //keys() 迭代器对象
      let st = s.keys();
      for (let i = 0; i < s.size; i++) {
          document.write(st.next().value+"<br>")
      }

      //删除
      document.write(s.delete("zz")+"<br>")


      let st2 = s.keys();
      for (let i = 0; i < s.size; i++) {
        document.write(st2.next().value+"<br>")
      }
    </script>
</body>
</html>